package com.pz.cloud.framework.business.workflow.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;

/**
 * 流程业务绑定表
 * @author mazezhan
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "act_process_bind")
@ApiModel(value = "act_process_bind对象", description = "流程业务绑定表")
public class ProcessBind {
    @TableId(type = IdType.ASSIGN_UUID)
    @ApiModelProperty(value = "id")
    private String id;//主键

    @ApiModelProperty(value = "业务表",required = true)
    private String relatedTable;//业务表

    @ApiModelProperty(value = "业务名称",required = true)
    private String bizName;//业务名称

    @ApiModelProperty(value = "流程定义key",required = true)
    private String processKey;//流程定义key

    @ApiModelProperty(value = "流程定义名称",required = true)
    private String processName;//流程名称

    @ApiModelProperty(value = "标题表达式 如;社团申请【${name}】",required = true)
    private String titleExpression;//标题表达式 如;社团申请【${name}】

    @ApiModelProperty(value = "优先级 根据关联表名找到流程绑定 最小最先匹配",required = true)
    private Integer priority;//优先级 根据关联表名找到流程绑定 最小最先匹配

    @TableField(exist = false)
    @ApiModelProperty(value = "规则列表")
    private List<ProcessBindRule> ruleList;

    @ApiModelProperty(value = "业务处理页面url")
    private String bizUrl;

    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

}
